From c2c88dd44c9cf8d15a42ba65ad39b0234b24fbe0 Mon Sep 17 00:00:00 2001 From: "awilliam@xenbuild2.aw" Date: Tue, 20 Mar 2007 09:24:02 -0600 Subject: [PATCH] [IA64] Avoid double free of VHPT for HVM domain If vTLB area is not able to allocate with shortage of domheap, Xen does a panic for double free of VHPT. At first: vmx_final_setup_guest() -> init_domain_tlb() -> free_domain_vhpt() At second: free_domain() -> vcpu_destroy() -> vmx_relinquish_vcpu_resources() -> free_domain_tlb() -> free_domain_vhpt() This patch avoids double free of VHPT by clearing v->arch.vhpt.hash in free_domain_vhpt(). Signed-off-by: Masaki Kanno --- xen/arch/ia64/vmx/vmmu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/arch/ia64/vmx/vmmu.c b/xen/arch/ia64/vmx/vmmu.c index 6a4ac502c2..917f274bf9 100644 --- a/xen/arch/ia64/vmx/vmmu.c +++ b/xen/arch/ia64/vmx/vmmu.c @@ -161,6 +161,7 @@ static void free_domain_vhpt(struct vcpu *v) if (v->arch.vhpt.hash) { page = virt_to_page(v->arch.vhpt.hash); free_domheap_pages(page, VCPU_VHPT_ORDER); + v->arch.vhpt.hash = 0; } return; -- 2.30.2